Skip to content

Obtain the start position of a string in another string, remove the leading and trailing spaces from a string, and split a string into an array

Use the position(http_type IN referer) function to obtain the start position of the value of the http_type field in the value of the http_method field. Use the trim function to remove the leading and trailing spaces from a string. Use the split (http_type, referer, 2) function to split a string into an array, with two values at most. The index of the first element in the array is 1. The results are displayed in a table.

SQL
|
select
  position(http_type IN referer) as "Obtain the start position of the value of the http_type field in the value of the http_method field",
  trim(referer) as "Remove the leading and trailing spaces from a string",
  split (http_type, referer, 2) as "Split a string into an array, with two values at most The index of the first element in the array is 1."